//
//  ViewController.m
//  2-29第一次课
//
//  Created by mac on 16-1-3.
//  Copyright (c) 2016年 yinbin. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    //UILabel
    self.title = @"标签";
    
    UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(50, 500, 50, 40)];
    label.backgroundColor = [UIColor yellowColor];
    label.text = @"☎️";
    label.textColor = [UIColor blackColor];
    //设置文字居中
    label.textAlignment =  NSTextAlignmentCenter; //UITextAlignmentCenter;
    //设置lable行数
    //UIButton *btn = [[UIButton alloc]initWithFrame:CGRectMake(20, 20, 20, 20)];
    [self.view addSubview:label];
    
    UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    button.frame = CGRectMake(150, 500, 40, 40);
    [button setTitle:@"🔘" forState:UIControlStateNormal];
    [button setTitle:@"点击状态" forState:UIControlStateHighlighted];
    [button addTarget:self action:@selector(myAction) forControlEvents:UIControlEventTouchUpInside];
    
    button.backgroundColor = [UIColor blueColor];
    [self.view addSubview:button];
    
    
}

- (void)myAction
{
    NSLog(@"您点击了按钮!");
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
